<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.printeverywhere.dto.BannedUser"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>

<s:form theme="simple" method="post">
<table width="100%" cellpadding="2" cellspacing="2" border="0">
	<tbody>
		<tr>
			<td height="40" colspan="2" class="sectionheading bottom-border">
				Block user list
			</td>
		</tr>
		<tr>
			<td>
				<s:actionerror cssClass="Note-red" />
				<s:actionmessage cssClass="verdana11greynormal" />
			</td>
		</tr>
		<tr>
			<td class="verdana12blacknormal" colspan="2">
				Find user:
				<input type="text" name="findUser" class="Textfiled-border">
				<s:submit action="findBlockUser" value="Submit" />
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<s:set var="pageSize" value="pageSize"  />
				<display:table name="bannedUserList" pagesize="${pageSize}" cellpadding="0" cellspacing="0" requestURI="" id="row" class="verdana12blacknormal">
					<display:column headerClass="Table-Head" title="Users" property="user.userId" />
					<display:column headerClass="Table-Head" title="Region" property="user.region.categoryName" />
					<display:column headerClass="Table-Head" title="Country" property="user.country.categoryName" />
					<display:column headerClass="Table-Head" title="Date" property="createDate" />
					<display:column headerClass="Table-Head" title="Reason" property="reason" />
					<display:column headerClass="Table-Head" title="Action">
						<a href="javascript:wantToDeleteWithURL('unblockBlockUser.htm?id=<%= ((BannedUser) row).getUser().getId() %>&pageSize=${pageSize}', 'Do you want to unblock user?')">Unblock</a>
					</display:column>
				</display:table>
			</td>
		</tr>
		<tr>
			<td class="verdana12blacknormal">
				Users per page <s:select name="pageSize" value="%{pageSize}" cssClass="textfiled-border" list="#{'10':'10','20':'20','50':'50','100':'100'}" theme="simple" onchange="document.forms[0].submit()"></s:select>
			</td>
			<td class="verdana12blacknormal" align="right">
				Add user
				<s:textfield name="user" cssClass="Textfiled-border" />
				for reason
				<s:textfield name="bannedUser.reason" cssClass="Textfiled-border" />
				<s:submit action="addBlockUser" value="Submit" />
			</td>
		</tr>
	</tbody>
</table>
</s:form>